import pandas as pd


# 读取 saas_mdm_public_area.xlsx
def read_excel_1():
    # 读取 excel 表格数据，并进行遍历
    # header = 0 ，第 1 行为表字段
    pd_read_excel = pd.read_excel("file\\saas_mdm_public_area.xlsx", sheet_name=0, header=0)
    # 遍历每一行数据
    for index, row in pd_read_excel.iterrows():
        area_id = row['area_id']
        area_name = row['area_name']
        area_english_name = row['area_english_name']
        if isinstance(area_english_name, float):
            area_english_name = ''

        if area_english_name != '':
            print(
                f"INSERT INTO saas_mdm_public_area_language(area_id,area_chinese_name,area_english_name) VALUES ({area_id},\"{area_name}\",\"{area_english_name}\");")



read_excel_1()
